package com.wjgl.dao;

import java.sql.Connection;
import java.sql.DriverManager;

public class DB {
	  private  Connection conn = null;

	  private  String url = "jdbc:mysql://localhost/wjgl";
	  private  String user = "root";
	  private  String password = "admin";
	  
	  public Connection getConn(){
		  try{
			  Class.forName("com.mysql.jdbc.Driver"); //加载mysql驱动
			  conn = DriverManager.getConnection(url,user,password);
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  return conn;
	  }

}
